from django.urls import path, re_path
from blog import views
app_name = 'blog'

urlpatterns = [
    # 传递参数正则写法
    re_path('personage/(?P<key>[0-9])', views.personage, name='personage'),

    path('user_info/', views.user_info, name='user_info'),
    # path('personage/<int:key>', views.personage, name='personage'),
    # 设置cookie
    path('set_cookie_view/', views.set_cookie_view, name='set_cookie_view'),
    # 获取cookie
    path('get_cookie_view/', views.get_cookie_view, name='get_cookie_view'),
    # 登录页面
    path('login/', views.login, name='login'),
    # 用户个人页面
    path('user/', views.user, name='user'),
    # 退出路由
    path('logout/', views.logout, name='logout'),
    # 搜索书籍
    path('search/', views.search_books, name='search'),
    # 添加书籍
    path('add_books/', views.add_books, name='add_books'),
    # 更新书的信息
    path('update/<int:book_id>', views.update, name='update'),
    # 删除书籍
    path('remove/<int:book_id>', views.remove, name='remove'),
]
